<script setup>
import { ref,reactive, onMounted,computed } from 'vue'
import { Plus } from '@element-plus/icons-vue'

const props = defineProps({
  imageUrl: String
})
let imageUrl = computed(()=>{
	return props.imageUrl;
})
const image = ref(props.imageUrl);

const handleSuccess = (response,uploadFile)  => {
		image.value = response.data.url;
}
defineExpose({
	image
})
</script>
<template>
	 <el-upload
          class="avatar-uploader"
          action="/api/admin/file/upload"
          :show-file-list="false"
          :on-success="handleSuccess"
        >
          <el-image  v-if="image" :src="image"  style="width: 100px; height: 100px" class="avatar" />
          <el-icon  v-else class="avatar-uploader-icon"><Plus /></el-icon>
        </el-upload>
</template>